<?php
defined('IN_XLP') or die('Access Denied');
$Document = array(
    'pageid'   => 'app-forum', //页面标示
    'pagename' => 'APP论坛系统消息', //当前页面名称
    'mycss'    => array(), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array(),
    'head'     => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<style>
tr th,tr td{text-align:center}
.left{float:left;}
.right{float:right;}
.txl{text-align:left}
.red{color:red;}
.pointer{cursor:pointer;}
.underline{text-decoration:underline;font-weight:bold;}
</style>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
    <!-- main padder -->
    <section class="main padder">
        <div class="clearfix">
            <h4><i class="fa fa-table"></i>论坛系统消息</h4>
            <section class="panel">
                <div class="panel-body">
                    <div class="input-group">
                        <a id="add" class="btn btn-sm btn-info" data-toggle="modal" href="<?php echo U("app/forum_add") ?>">
                            <i class="fa fa-fw fa-plus"></i>添加消息
                        </a>
                    </div>
                    <br>
                    <div class="table-responsive">
                        <table class="table table-striped b-t text-small">
                            <thead>
                                <tr>
                                    <th width="">序号</th>
                                    <th width="">标题</th>
                                    <th width="">模块</th>
                                    <th width="">参数</th>
                                    <th width="">发布时间</th>
                                    <th width="">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if (!empty($msg_list)): ?>
                                <?php $i = 1; ?>
                                <?php foreach ($msg_list as $k => $v): ?>
                                <tr>
                                    <td><?php echo $i;$i++; ?></td>
                                    <td><?php echo $v['title'] ?></td>
                                    <td><?php echo $v['mode'] ?></td>
                                    <td><?php echo $v['para'] ?></td>
                                    <td><?php echo $v['time'] ?></td>
                                    <td>
                                        <div class="btn-group">
                                            <button class="btn btn-white btn-xs dropdown-toggle" data-toggle="dropdown">操作<span class="caret"></span></button>
                                            <ul class="dropdown-menu">
                                                <li><a target="_blank" href="<?php echo U('app/forum_edit',array('id'=>$v['id'])) ?>">编辑</a></li>
                                                <li><a href="javascript:;" onclick="del('<?php echo $v['id'] ?>',this);">删除</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach ?>

                                <?php else: ?>
                                
                                <?php endif ?>
                            </tbody>
                        </table>
                    </div>
                    
                    <footer class="panel-footer">
                        <div class="row">
                            <div class="col-sm-12 text-right text-center-sm">
                                <?php echo page($total,$page,'', 10, 'page');?>
                            </div>
                        </div>
                    </footer>

                </div>
            </section>
        </div>
    </section>
    <!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
var del_url  = "<?php echo U('app/del') ?>";

$(function(){

});

function del(_id, t) {
    if(!confirm('真的要删除此条数据吗？')) {
        return false;
    }
    $this = $(t);
    $.get(del_url, {"id":_id,"t":"forum"}, function(res){
        if(res.status==1) {
            $this.closest('tr').remove();
        } else {
            Msg.error(res.info);
        }
    }, 'JSON');
}

</script>
<?php include getTpl('footer', 'public'); ?>